<?php


namespace app\common\model;


use think\Model;

class UserActivityModel extends Model {

    public function activity() {
        return $this->hasOne(ActivityModel::class, 'id', 'activity_id')->field('id,title,start_time,end_time,carat,eagle_drill,experience');
    }

    /**
     * 奖励关联，关联
     * @return \think\model\relation\HasMany
     */
    public function reward() {
        return $this->hasMany(ActivityRewardModel::class, 'activity_id', 'activity_id')->with(['props', 'gift']);
    }

}